package com.syf.kit.core.dao.mapper.registry;

import com.baomidou.mybatisplus.core.MybatisConfiguration;
import com.syf.kit.core.dao.mapper.SyfMapper;
import org.apache.ibatis.session.SqlSessionFactory;

public class SyfMPDtoMapperRegistry extends SyfAbstractDtoMapperRegistry<MybatisConfiguration>{
    /**
     * @param scanPkg 扫描dto类的初始package
     */
    public SyfMPDtoMapperRegistry(String scanPkg) {
        super(scanPkg);
    }

    @Override
    public Class getBaseMapperType() {
        return SyfMapper.class;
    }

    @Override
    public void registerMapper(SqlSessionFactory sqlSessionFactory, MybatisConfiguration mybatisConfiguration) {
        for (Class<SyfMapper> mapperClass : getAllMapperMap().values()) {
            mybatisConfiguration.addMapper(mapperClass);
        }
    }
}
